package com.pcjavanet.generate;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class ReadConfigure {
	
	private String readBeanPackagePath;
	private String outputAbsolutePath;
	private String outputBasePackagePath;
	private String outputJspPath;
	public String getOutputJspPath() {
		return outputJspPath;
	}
	public void setOutputJspPath(String outputJspPath) {
		this.outputJspPath = outputJspPath;
	}


	private Properties props ;
	
	public ReadConfigure(String path) {
		initProp(path);
	}
	public String getReadBeanPackagePath() {
		return readBeanPackagePath;
	}
	public void setReadBeanPackagePath(String readBeanPackagePath) {
		this.readBeanPackagePath = readBeanPackagePath;
	}
	public String getOutputAbsolutePath() {
		return outputAbsolutePath;
	}
	public void setOutputAbsolutePath(String outputAbsolutePath) {
		this.outputAbsolutePath = outputAbsolutePath;
	}
	public String getOutputBasePackagePath() {
		return outputBasePackagePath;
	}
	public void setOutputBasePackagePath(String outputBasePackagePath) {
		this.outputBasePackagePath = outputBasePackagePath;
	}
	

	private void initProp(String path){
		props = new Properties();
		try {
			InputStream inputs = new BufferedInputStream(new FileInputStream(path));
			props.load(inputs);
//			Enumeration enums = props.propertyNames();
//			while ( enums.hasMoreElements() ){
//				String key = (String)enums.nextElement();
//				String value = props.getProperty(key);
//				
//			}
		  readBeanPackagePath = props.getProperty("readBeanPackagePath" );
		  outputAbsolutePath = props.getProperty("outputAbsolutePath" );
		  outputBasePackagePath = props.getProperty("outputBasePackagePath" );
		  outputJspPath = props.getProperty("outputJspPath" );
		}catch(Exception e){
			e.printStackTrace();
		}
		
		
		
		
		
	}
}
